<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:f="http://xmlns.jcp.org/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition>

        <p:dialog id="EventCreateDlg" widgetVar="EventCreateDialog" modal="true" resizable="false" appendTo="@(body)" header="#{bundle.CreateEventTitle}">
            <h:form id="EventCreateForm">
                <h:panelGroup id="display">
                    <p:panelGrid columns="2" rendered="#{eventController.selected != null}">
                        <p:outputLabel value="#{bundle.CreateEventLabel_id}" for="id" />
                        <p:inputText id="id" value="#{eventController.selected.id}" title="#{bundle.CreateEventTitle_id}" required="true" requiredMessage="#{bundle.CreateEventRequiredMessage_id}"/>
                        <p:outputLabel value="#{bundle.CreateEventLabel_name}" for="name" />
                        <p:inputText id="name" value="#{eventController.selected.name}" title="#{bundle.CreateEventTitle_name}" />
                        <p:outputLabel value="#{bundle.CreateEventLabel_introduction}" for="introduction" />
                        <p:inputText id="introduction" value="#{eventController.selected.introduction}" title="#{bundle.CreateEventTitle_introduction}" />
                        <p:outputLabel value="#{bundle.CreateEventLabel_conductTime}" for="conductTime" />
                        <p:calendar id="conductTime" pattern="MM/dd/yyyy HH:mm:ss" value="#{eventController.selected.conductTime}" title="#{bundle.EditEventTitle_conductTime}"  showOn="button"/>
                        <p:outputLabel value="#{bundle.CreateEventLabel_createdDate}" for="createdDate" />
                        <p:calendar id="createdDate" pattern="MM/dd/yyyy HH:mm:ss" value="#{eventController.selected.createdDate}" title="#{bundle.EditEventTitle_createdDate}"  showOn="button"/>
                        <p:outputLabel value="#{bundle.CreateEventLabel_fee}" for="fee" />
                        <p:inputText id="fee" value="#{eventController.selected.fee}" title="#{bundle.CreateEventTitle_fee}" />
                        <p:outputLabel value="#{bundle.CreateEventLabel_speaker}" for="speaker" />
                        <p:inputText id="speaker" value="#{eventController.selected.speaker}" title="#{bundle.CreateEventTitle_speaker}" />
                        <p:outputLabel value="#{bundle.CreateEventLabel_guest}" for="guest" />
                        <p:inputText id="guest" value="#{eventController.selected.guest}" title="#{bundle.CreateEventTitle_guest}" />
                        <p:outputLabel value="#{bundle.CreateEventLabel_prize}" for="prize" />
                        <p:inputText id="prize" value="#{eventController.selected.prize}" title="#{bundle.CreateEventTitle_prize}" />
                        <p:outputLabel value="#{bundle.CreateEventLabel_address}" for="address" />
                        <p:inputText id="address" value="#{eventController.selected.address}" title="#{bundle.CreateEventTitle_address}" />
                        <p:outputLabel value="#{bundle.CreateEventLabel_procedure}" for="procedure" />
                        <p:inputText id="procedure" value="#{eventController.selected.procedure}" title="#{bundle.CreateEventTitle_procedure}" />
                        <p:outputLabel value="#{bundle.CreateEventLabel_term}" for="term" />
                        <p:inputText id="term" value="#{eventController.selected.term}" title="#{bundle.CreateEventTitle_term}" />
                        <p:outputLabel value="#{bundle.CreateEventLabel_criteria}" for="criteria" />
                        <p:inputText id="criteria" value="#{eventController.selected.criteria}" title="#{bundle.CreateEventTitle_criteria}" />
                        <p:outputLabel value="#{bundle.CreateEventLabel_activityId}" for="activityId" />
                        <p:inputText id="activityId" value="#{eventController.selected.activityId}" title="#{bundle.CreateEventTitle_activityId}" />
                        <p:outputLabel value="#{bundle.CreateEventLabel_activity}" for="activity" />
                        <p:selectOneMenu id="activity" value="#{eventController.selected.activity}" required="true" requiredMessage="#{bundle.EditEventRequiredMessage_activity}">
                            <f:selectItems value="#{activityController.itemsAvailableSelectOne}"
                                           var="activityItem"
                                           itemValue="#{activityItem}"/>
                        </p:selectOneMenu>
                    </p:panelGrid>
                    <p:commandButton actionListener="#{eventController.create}" value="#{bundle.Save}" update="display,:EventListForm:datalist,:growl" oncomplete="handleSubmit(args,'EventCreateDialog');"/>
                    <p:commandButton value="#{bundle.Cancel}" onclick="EventCreateDialog.hide()"/>
                </h:panelGroup>
            </h:form>
        </p:dialog>

    </ui:composition>
</html>
